{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Popover from '../popover';\nimport { cloneElement } from '../_util/reactNode';\nimport Avatar from './avatar';\nimport { SizeContextProvider } from './SizeContext';\nimport useStyle from './style';\nvar Group = function Group(props) {\n  var _React$useContext = React.useContext(ConfigContext),\n    getPrefixCls = _React$useContext.getPrefixCls,\n    direction = _React$useContext.direction;\n  var customizePrefixCls = props.prefixCls,\n    _props$className = props.className,\n    className = _props$className === void 0 ? '' : _props$className,\n    maxCount = props.maxCount,\n    maxStyle = props.maxStyle,\n    size = props.size;\n  var prefixCls = getPrefixCls('avatar', customizePrefixCls);\n  var groupPrefixCls = \"\".concat(prefixCls, \"-group\");\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    wrapSSR = _useStyle2[0],\n    hashId = _useStyle2[1];\n  var cls = classNames(groupPrefixCls, _defineProperty({}, \"\".concat(groupPrefixCls, \"-rtl\"), direction === 'rtl'), className, hashId);\n  var children = props.children,\n    _props$maxPopoverPlac = props.maxPopoverPlacement,\n    maxPopoverPlacement = _props$maxPopoverPlac === void 0 ? 'top' : _props$maxPopoverPlac,\n    _props$maxPopoverTrig = props.maxPopoverTrigger,\n    maxPopoverTrigger = _props$maxPopoverTrig === void 0 ? 'hover' : _props$maxPopoverTrig;\n  var childrenWithProps = toArray(children).map(function (child, index) {\n    return cloneElement(child, {\n      key: \"avatar-key-\".concat(index)\n    });\n  });\n  var numOfChildren = childrenWithProps.length;\n  if (maxCount && maxCount < numOfChildren) {\n    var childrenShow = childrenWithProps.slice(0, maxCount);\n    var childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);\n    childrenShow.push( /*#__PURE__*/React.createElement(Popover, {\n      key: \"avatar-popover-key\",\n      content: childrenHidden,\n      trigger: maxPopoverTrigger,\n      placement: maxPopoverPlacement,\n      overlayClassName: \"\".concat(groupPrefixCls, \"-popover\")\n    }, /*#__PURE__*/React.createElement(Avatar, {\n      style: maxStyle\n    }, \"+\".concat(numOfChildren - maxCount))));\n    return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n      size: size\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: cls,\n      style: props.style\n    }, childrenShow)));\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: cls,\n    style: props.style\n  }, childrenWithProps)));\n};\nexport default Group;","map":{"version":3,"names":["classNames","toArray","React","ConfigContext","Popover","cloneElement","Avatar","SizeContextProvider","useStyle","Group","props","useContext","getPrefixCls","direction","customizePrefixCls","prefixCls","className","maxCount","maxStyle","size","groupPrefixCls","wrapSSR","hashId","cls","children","maxPopoverPlacement","maxPopoverTrigger","childrenWithProps","map","child","index","key","numOfChildren","length","childrenShow","slice","childrenHidden","push","createElement","content","trigger","placement","overlayClassName","style"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/avatar/group.js"],"sourcesContent":["import classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Popover from '../popover';\nimport { cloneElement } from '../_util/reactNode';\nimport Avatar from './avatar';\nimport { SizeContextProvider } from './SizeContext';\nimport useStyle from './style';\nconst Group = props => {\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className = '',\n    maxCount,\n    maxStyle,\n    size\n  } = props;\n  const prefixCls = getPrefixCls('avatar', customizePrefixCls);\n  const groupPrefixCls = `${prefixCls}-group`;\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const cls = classNames(groupPrefixCls, {\n    [`${groupPrefixCls}-rtl`]: direction === 'rtl'\n  }, className, hashId);\n  const {\n    children,\n    maxPopoverPlacement = 'top',\n    maxPopoverTrigger = 'hover'\n  } = props;\n  const childrenWithProps = toArray(children).map((child, index) => cloneElement(child, {\n    key: `avatar-key-${index}`\n  }));\n  const numOfChildren = childrenWithProps.length;\n  if (maxCount && maxCount < numOfChildren) {\n    const childrenShow = childrenWithProps.slice(0, maxCount);\n    const childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);\n    childrenShow.push( /*#__PURE__*/React.createElement(Popover, {\n      key: \"avatar-popover-key\",\n      content: childrenHidden,\n      trigger: maxPopoverTrigger,\n      placement: maxPopoverPlacement,\n      overlayClassName: `${groupPrefixCls}-popover`\n    }, /*#__PURE__*/React.createElement(Avatar, {\n      style: maxStyle\n    }, `+${numOfChildren - maxCount}`)));\n    return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n      size: size\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: cls,\n      style: props.style\n    }, childrenShow)));\n  }\n  return wrapSSR( /*#__PURE__*/React.createElement(SizeContextProvider, {\n    size: size\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    className: cls,\n    style: props.style\n  }, childrenWithProps)));\n};\nexport default Group;"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,mBAAmB,QAAQ,eAAe;AACnD,OAAOC,QAAQ,MAAM,SAAS;AAC9B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAGC,KAAK,EAAI;EACrB,wBAGIR,KAAK,CAACS,UAAU,C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